package com.ioc.business.order.domain.bo.plan.arrival;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ioc.business.order.domain.bo.plan.arrival.item.PlanArrivalOrderItemBo;
import com.ioc.common.validate.AddGroup;
import com.ioc.common.validate.EditGroup;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

@Data
public class PlanArrivalOrderBo {

    /**
     * 计划到货订单ID
     */
    @NotNull(message = "计划到货订单ID不能为空", groups = {EditGroup.class})
    private Long planArrivalOrderId;

    /**
     * 计划到货日期
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
    @NotNull(message = "计划到货日期不能为空", groups = {AddGroup.class, EditGroup.class})
    private Date arrivalOrderDate;

    /**
     * 订单项
     */
    @Valid
    @NotEmpty
    private List<PlanArrivalOrderItemBo> orderItemList;
}
